import {
  download
} from '@/utils/request.js'

export default {
  methods: {
    roleFenpei: function (params) {
      return this.request({
        url: this.roleFenpeiUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    resetPassword: function (params) {
      return this.request({
        url: this.resetPasswordUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    dataFenpei: function (params) {
      return this.request({
        url: this.dataFenpeiUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    importPeople: function (params) {
      return this.request({
        url: this.importPeopleUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    getHavedRole: function (params) {
      return this.request({
        url: this.getHavedRoleUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    getHavedImportPeople: function (params) {
      return this.request({
        url: this.getHavedImportPeopleUrl,
        method: 'post',
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        data: params
      })
    },
    getAllPath: function (params) {
      return this.request({
        url: this.getAllPathUrl,
        method: 'get',
        params
      })
    },
    // 批量导入
    batchImport: function (data, params) {
      return this.request({
        url: this.batchImportUrl,
        method: 'post',
        headers: {
          "Content-Type": "multipart/form-data"
        },
        data,
        params
      })
    },
    // 下载模板
    downloadTemplate: function (params) {
      return download({
        url: this.downloadTemplateUrl,
        method: 'get',
        params
      })
    }
  }
}
